<?php

	function myException($i)
	{
		if ($i > 1)
		{
			//echo '输入的数值必须大于1!';
			throw new Exception('数值必须小于或者等于1');
		}
	}
	try
	{
		myException(2);		
	}
	catch(Exception $e)
	{
		/*$exp_error = get_class_methods($e);
		foreach ($exp_error as $method_name)
		{
			echo $e->$method_name().'<br />';
		}*/
		echo $e->getCode().':'.$e->getMessage().'<br />';
	}
?>